home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / os2tools / os2life / int33h.asm < prev    next >
Assembly Source File  |  1988-02-29  |  1KB  |  50 lines

  1. ;***    _int33h - simple program to call the mouse interput hex 33
  2. ;*
  3. ;*    Passed in [bp+4] is the offset in ds of a six word
  4. ;*    array containing the data to place in ax,bx,cx, and
  5. ;*    dx for the int 33h.  An int 33h is then called
  6. ;*    and ax,bx,cx and dx are returned in the same array.
  7. ;*    To call from C, store the registers you wish to pass
  8. ;*    in a near array and call like this:
  9. ;*
  10. ;*        int33h (®isters);
  11. ;*
  12. ;*  Created by Microsoft Corp. 1987
  13. ;
  14. _TEXT    SEGMENT  BYTE PUBLIC 'CODE'
  15. _TEXT    ENDS
  16. _DATA    SEGMENT  WORD PUBLIC 'DATA'
  17. _DATA    ENDS
  18. CONST    SEGMENT  WORD PUBLIC 'CONST'
  19. CONST    ENDS
  20. _BSS    SEGMENT  WORD PUBLIC 'BSS'
  21. _BSS    ENDS
  22. DGROUP    GROUP    CONST, _BSS, _DATA
  23.     ASSUME    CS: _TEXT, DS: DGROUP, SS: DGROUP, ES: DGROUP
  24. _TEXT       SEGMENT
  25.     PUBLIC    _int33h
  26. _int33h PROC NEAR
  27.     push    bp
  28.     mov    bp,sp
  29.     push    di
  30.     push    si
  31.     mov    si,WORD PTR [bp+4]    ; (ds:si) = array of passed registers
  32.     mov    ax,[si]         ; load registers for int
  33.     mov    bx,[si+2]
  34.     mov    cx,[si+4]
  35.     mov    dx,[si+6]
  36.     int    33h
  37.     mov    [si],ax         ; load in returned registers
  38.     mov    [si+2],bx
  39.     mov    [si+4],cx
  40.     mov    [si+6],dx
  41.     pop    si
  42.     pop    di
  43.     mov    sp,bp            ; exit
  44.     pop    bp
  45.     ret
  46. _int33h ENDP
  47. _TEXT    ENDS
  48. END
  49. 
  50.